<?php
session_start();
$response = array();
if (isset($_GET['callback'])) {
	//register session for new login user
	$email = $_GET['email'];
	if (!isset($_SESSION["$email"])) {
		$_SESSION["$email"] = 0;
		$_SESSION["aaa"] = 1;
	}
	$password = $_GET['password'];
	
	// include db connect class
    require_once __DIR__ . '/db_connect.php';
 
    // connecting to db
    $db = new DB_CONNECT();
	
	$result = mysql_query("SELECT * FROM user_info WHERE email='$email' AND password='$password'");
	$num_rows = mysql_num_rows($result);
	
	if ($num_rows >= 1) {
		// successfully inserted into database
		$response["success"] = 1;
		$response["message"] = "true";
 
	} else {
		$response["success"] = 0;
		$response["message"] = "false";
	}

	//$arr = array("element1","element2",array("element31","element32"));
	
	echo $_GET['callback']."(".json_encode($response).");";
	
}

?>